Field of the Invention
The present invention relates to a communication apparatus capable of participating in a plurality of networks, a method for controlling the communication apparatus, and a program.
Description of the Related Art
In wireless communication, such as a wireless local area network (LAN) which is atypical example, conforming with the standard series of Institute of Electrical and Electronics Engineers (IEEE) 802.11, an infrastructure mode, in which an access point (a base station) controls a network, and an ad-hoc mode, in which terminal apparatuses autonomously form a network, are defined.
A method for realizing connection to a base station in the infrastructure mode and simultaneously communicating with another terminal apparatus in the ad-hoc mode has been discussed (for example, see Japanese Patent Application Laid-Open No. 2005-64552).
The function constituting a plurality of networks using a single terminal apparatus is called a multi-basic service set (BSS) function. The multi-BSS function may be performed on a single wireless LAN interface due to a reason such as cost reduction. When the connection with a base station in the infrastructure mode and simultaneous communication with other terminal apparatuses in the ad-hoc mode are realized by the multi-BSS function, the communication of each mode is performed on the same wireless LAN channel (a frequency channel). Therefore, when the wireless LAN channel on the side of the infrastructure mode (an infrastructure mode) is changed due to a reason such as roaming, the communication on the side of the ad-hoc mode also needs to be changed to the same wireless LAN channel.
A case will be considered in which a terminal apparatus establishing connection to a base station in the infrastructure mode and simultaneously communicating with another terminal in the ad-hoc mode changes the communication channel of the side of the infrastructure mode because of roaming. In this case, when the terminal apparatus also changes the communication channel of the side of the ad-hoc mode, the terminal apparatus is separated from the ad-hoc network.
Therefore, communication with another terminal apparatus present in the ad-hoc network may become unavailable. Herein, when the other terminal apparatus detects the separation of the terminal apparatus having performed the roaming, the other terminal apparatus can detect the terminal apparatus having performing the roaming on another channel by scanning the wireless network. However, when the terminal apparatus having performed the roaming already ends the ad-hoc mode communication, the other terminal apparatus consequently scans the wireless network in vain in spite of the fact that the other terminal apparatus cannot detect the terminal apparatus having performed the roaming.